home *** CD-ROM | disk | FTP | other *** search
/ New Perspectives on Computer Concepts / New Perspectives on Computer Concepts.iso / np2010c / page785.pag < prev    next >
Portable Network Graphic  |  2008-10-02  |  73KB  |  817x1045  |  8-bit (256 colors)
Labels: chat room | dialog box | hakham | laptop | monitor | web site
OCR: COMPUTER PROGRAMMING 7 1 7 What is instantiation? Finding value for a variable is referred to as instantiation. To solve the goal sizeof (pizza2 Inches) Prolog instantiates the value 14 to the variable Iinches. Instantiation means to make temporary assignment. When Prolog program discovers that the size of pizza2 is 14 inches, it instantiates, or assigns, the value 14 to the variable Inches Prolog can perform multiple instantiations You can ask for the sizes of both pizzas by using the query ? izeo (Pizza Inches) Capitalizing the words Pizza and Inches signifies that both are variables Prolog can instan- tiate Pizza to pizza and then instantiate it to pizza2: Pizza pizzal Inches Pizza pizza2 Inches You can also formulate queries in which you tell Prolog you to instantiate variable For exam ...